package cl.whyem.test.cert.ocpjp6.threads;

public class GotoGood extends Thread {

    private int x = 2;

    public static void main(String[] args) throws Exception {
        new GotoGood().makeItSo();
    }

    public GotoGood() {
        System.out.println("test");
        x = 5;
        start();
    }

    public void makeItSo() throws Exception {
        join();     
        x = x - 1;
        System.out.println(x);
    }

    @Override
    public void run() {
        System.out.println("run");
        x *= 2;
    }
}
